package com.aloda.mapper;


import com.aloda.entity.Team;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
* @author aloda
* @description 针对表【team(队伍表)】的数据库操作Mapper
* @createDate 2024-11-05 21:51:38
* @Entity generator.domain.Team
*/
public interface TeamMapper extends BaseMapper<Team> {


    /**
     * 根据id查询用户创建队伍数量
     * @param currentUserId
     * @return
     */
    @Select("select count(*) from team where user_id = #{currentUserId}")
    Long queryUserTeamNumById(Long currentUserId);

    /**
     * 根据id增加队伍人数
     * @param id
     * @return
     */
    @Update("update team set member_num = member_num + 1 where id = #{id}")
    Boolean updateMemberNum(Long id);
}




